package com.dgut.admodule.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

@Entity
@Table(name="t_advertisement")
public class Ad {
	private Long adId;
	private String adsName;
	private String adsDescription;
	@DateTimeFormat(pattern="yyyy/MM/dd HH:mm:ss")
	private Date adsbTime;//开始时间
	@DateTimeFormat(pattern="yyyy/MM/dd HH:mm:ss")
	private Date adssTime;//结束时间
	private String adsCompany;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getAdId() {
		return adId;
	}
	public String getAdsName() {
		return adsName;
	}
	public String getAdsDescription() {
		return adsDescription;
	}
	@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss",timezone = "GMT+8")
	public Date getAdsbTime() {
		return adsbTime;
	}
	@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss",timezone = "GMT+8")
	public Date getAdssTime() {
		return adssTime;
	}
	public String getAdsCompany() {
		return adsCompany;
	}
	
	public void setAdId(Long adId) {
		this.adId = adId;
	}
	public void setAdsName(String adsName) {
		this.adsName = adsName;
	}
	public void setAdsDescription(String adsDescription) {
		this.adsDescription = adsDescription;
	}
	public void setAdsbTime(Date adsbTime) {
		this.adsbTime = adsbTime;
	}
	public void setAdssTime(Date adssTime) {
		this.adssTime = adssTime;
	}
	public void setAdsCompany(String adsCompany) {
		this.adsCompany = adsCompany;
	}
	
	@Override
	public String toString() {
		return "Ad [adId=" + adId + ", adsName=" + adsName + ", adsDescription=" + adsDescription + ", adsbTime="
				+ adsbTime + ", adssTime=" + adssTime + ", adsCompany=" + adsCompany + "]";
	}
	
}
